﻿<Window x:Class="Sidvall.LogManager.UI.Wpf.MainWindow" 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:b="clr-namespace:Sidvall.UI.Wpf.Controls;assembly=Sidvall.UI.Wpf" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	mc:Ignorable="d"
	xmlns:vms="clr-namespace:Sidvall.LogManager.UI.ViewModels;assembly=Sidvall.LogManager.UI"
	xmlns:Converters="clr-namespace:Sidvall.UI.Wpf.Converters;assembly=Sidvall.UI.Wpf" 
	Title="Sidvall Log Manager" Height="400" Width="600" Closing="Window_Closing" WindowStartupLocation="CenterScreen" Icon="Application.ico">

	<Window.Resources>
		<Converters:InverseBooleanConverter x:Key="InverseBooleanConverter"/>
		<Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
		<Converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter2" Not="True" />
	</Window.Resources>
	<Window.InputBindings>
		<KeyBinding Modifiers="Alt" Key="Left" Command="{Binding ToolViewModel.GoBackCommand}" />
		<KeyBinding Modifiers="Alt" Key="Right" Command="{Binding ToolViewModel.GoForwardCommand}" />
	</Window.InputBindings>

	<Grid d:DataContext="{d:DesignInstance IsDesignTimeCreatable=True, Type={x:Type vms:MainWindowViewModel}}">
		<Grid>
			<b:BusyIndicatorControl HeaderCaption="{Binding IsBusyMessage}" Visibility="{Binding IsBusyAndStarted, Converter={StaticResource BooleanToVisibilityConverter}}" Panel.ZIndex="10" />
			<Grid HorizontalAlignment="Stretch">
				<Grid.RowDefinitions>
					<RowDefinition Height="Auto" />
					<RowDefinition />
					<RowDefinition Height="Auto" />
				</Grid.RowDefinitions>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition />
					<ColumnDefinition Width="Auto" />
				</Grid.ColumnDefinitions>

				<ContentControl Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" x:Name="HeaderContent" />

				<ContentControl Grid.Row="1" Grid.Column="0" x:Name="LeftContent" Panel.ZIndex="1" IsEnabled="{Binding IsNotBusyAndStarted}" />
				<Border Grid.Row="1" Grid.Column="1" BorderThickness="0" Padding="0,0,0,0" IsEnabled="{Binding IsBusy, Converter={StaticResource InverseBooleanConverter}}">
					<ContentControl x:Name="CenterContent" />
				</Border>
				<ContentControl Grid.Row="1" Grid.Column="2" x:Name="RightContent" />

				<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" x:Name="FooterContent" />
			</Grid>
		</Grid>
	</Grid>
</Window>
